package com.rhythm.commons.io.filters;

import java.io.File;
import java.io.FileFilter;

/**
 *File filter for only files and not directories
 *
 * @author mlee
 * @see FileFilter
 */
public class FileOnlyFileFilter implements FileFilter {

    private static final FileOnlyFileFilter INSTANCE = new FileOnlyFileFilter();

    /**
     * Returns a singleton instance of the {@code FileOnlyFilter}
     * @return
     */
    public static FileOnlyFileFilter getInstance(){
        return INSTANCE;
    }

    private FileOnlyFileFilter() {
        //Don't expose.
    }
    
    public boolean accept(File pathname) {
        return pathname.isFile();
    }
}
